package com.example.edu.coupon;

import com.example.edu.coupon.strategy.QuoteStrategy;

import java.math.BigDecimal;

/**
 * @author yanzhao
 * @date 2022/2/18 14:27
 * @since 1.0.0
 */
public class QuoteContext<T> {

    private QuoteStrategy<T> quoteStrategy;

    public QuoteContext(QuoteStrategy<T> quoteStrategy) {
        this.quoteStrategy = quoteStrategy;
    }

    public BigDecimal discountAmount(T quoteCondition, BigDecimal price) {
        return quoteStrategy.quote(quoteCondition, price);
    }
}
